/**
 * User: Oleksii Savchenko
 * Date: 07.02.13
 * Time: 15:19
 */
var baseUrl = 'http://localhost:3000/';
var ajaxService = new ItemAjaxService(baseUrl);


console.log('ok');

var data = {"name":"Kraz", "price": 18050};

ajaxService.create(data, function(response){
    var key = response;
    ajaxService.getItemById({"id": key}, function(response_array){
        console.log(response_array);
        var items = {
            data: {"name":"Kraz111", "price": 10540},
            params: {id: key}
        };

        ajaxService.update(items, function(res){
            ajaxService.getItemById({"id":key}, function(response_array){
                console.log(response_array);
            });
        });
    });

});



